package com.orange.strategyPatterns;

/**
 * @Description:没有使用策略模式时的支付代码
 */
public class NoUseStrategy {
    public void pay(String payType, Integer amount){
        if(payType=="wechat"){
            //1日志记录
            System.out.println("Pay " + amount + " yuan");
            System.out.println("Pay " + amount + " yuan");
            System.out.println("Pay " + amount + " yuan");
            //2记录传入参数
            System.out.println(amount);
            System.out.println(amount);
            System.out.println(amount);
            System.out.println(amount);
            //3发送消息给管理者
            System.out.println("开始支付");
            //4引入微信支付api
            System.out.println("引入微信api");
            //5使用微信api查看余额
            System.out.println("查看余额");
            //6判断余额是否充足
            System.out.println("判断中");
            //7调用微信支付的API完成支付
            System.out.println("Wechat Pay " + amount + " yuan");
            //8通知消费者
            System.out.println("支付成功");
        }
        if(payType=="applePay"){
            //1日志记录
            System.out.println("Pay " + amount + " yuan");
            System.out.println("Pay " + amount + " yuan");
            System.out.println("Pay " + amount + " yuan");
            //2记录传入参数
            System.out.println(amount);
            System.out.println(amount);
            System.out.println(amount);
            System.out.println(amount);
            //3发送消息给管理者
            System.out.println("开始支付");
            //4引入apple支付api
            System.out.println("引入apple api");
            //5使用apple api查看余额
            System.out.println("查看余额");
            //6判断余额是否充足
            System.out.println("判断中");
            //7调用apple支付的API完成支付
            System.out.println("苹果 Pay " + amount + " yuan");
            //8通知消费者
            System.out.println("支付成功");
        }
    }
}
